From 583076ba319c2c6402503caaa0b9cbf9188ce052 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 12 Sep 2005 20:38:47 +0000 Subject: [PATCH] More space-efficient storage of handles. --- gpsbabel/mkshort.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index 37a135096..4f11d4fda 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -39,16 +39,17 @@ static const char vowels[] = "aeiouAEIOU"; #define PRIME 37 typedef struct { - int mustupper; - int whitespaceok; - int repeating_whitespaceok; unsigned int target_len; char *badchars; char *goodchars; char *defname; - int must_uniq; queue namelist[PRIME]; - int depth[PRIME]; + + /* Various internal flags at end to allow alignment flexibility. */ + unsigned int mustupper:1; + unsigned int whitespaceok:1; + unsigned int repeating_whitespaceok:1; + unsigned int must_uniq:1; } mkshort_handle; typedef struct { @@ -86,7 +87,7 @@ mkshort_new_handle() h->whitespaceok = 1; h->badchars = DEFAULT_BADCHARS; h->target_len = DEFAULT_TARGET_LEN; - h->must_uniq=1; + h->must_uniq = 1; h->defname = xstrdup("WPT"); return h; @@ -174,7 +175,8 @@ mkshort_del_handle(void *h) setshort_badchars(h, NULL); if (hdr->defname) { xfree(hdr->defname); - } + } + xfree(hdr); } -- 2.30.2